<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title></title>
		<link rel="stylesheet" type="text/css"
			href="${contextPath}/resource/css/default.css" />
		<script src="${contextPath}/resource/js/index.js"></script>
		
			<script src="${contextPath}/resource/js/prototype-1.6.0.2.js"></script>
		<script src="${contextPath}/resource/js/menu.js"></script>
		
	</head>
	<body >
	
	<table class="menu_table">
	<tr><th><a href="menuAction_find.do">菜单管理</a>&gt;&gt;添加导航菜单</th></tr>
	</table>
<div class="listtable">
	<div class="secondDiv">
		<table class="data_js_table" id="js_table">
			<tr>
				<th width="25%">菜单名字</th>
				<th width="15%">是否是菜单</th>
				<th width="15%">排序</th>
				<th>操作</th>
			</tr>
					<s:iterator value="listMenu" var="children">
						<tr>
							<td class="VTSMA"><s:property value="#children.name" /></td>
							<td>
							<s:property value="flgMap[#children.ismenu]"/>
							</td>
							<td><s:property value="#children.orders" /></td>
							<td><s:if test="#children.ismenu==1">
									<a href="menuAction_add.do?menu.parentid=<s:property value="#children.id" />" title="新增">
										<img src="${contextPath}/resource/img/ico/addlist.png" class="edit_style" align="middle" alt="新增"></img>
									</a>&nbsp;|&nbsp;
						  		</s:if>
								<a href="menuAction_edit.do?menu.id=<s:property value="#children.id" />"" title="修改" >
									<img src="${contextPath}/resource/img/ico/edit.png" class="edit_style" align="middle" alt="修改"></img>
								</a>&nbsp;|&nbsp;
								<a href="javascript:void(0)" onclick="isPost('确认删除?','menuAction_delete.do?menu.id=<s:property value="#children.id" />')" title="删除">
									<img src="${contextPath}/resource/img/ico/delete.png" class="delete_style" align="middle" alt="删除"></img>
								</a>
							</td>
						</tr>
						</s:iterator>
						<s:if test="listMenu == null || listMenu.size == 0">
						<tr><td colspan="4"><font color="#ff00ff" size="3">暂无数据</font></td></tr>
						</s:if>
						</table></div></div>
	   <s:form action="menuAction_saveorUpdate.do" method="post" namespace="/" onsubmit="return isSubmit('menu.name','resultMenuName')">
		<s:hidden name="menu.parentid"/>
		<s:hidden name="menu.id"/>
		<s:hidden name="menu.prmssCd"/>
		<div class="listtable">
<div class="secondDiv">
			<table class="data_js_table">
				<tr><th>
					<s:if test="menu.id==null">新增菜单</s:if>
					<s:else>编辑菜单</s:else>
				</th></tr>
			</table>
			<table class="form_table">
				<tr>
					<th width="22%">菜单名</th>
					<td width="78%">
						<s:textfield name="menu.name" id="menu.name" size="30"
							maxlength="50" onblur="validate('menu.name','resultMenuName')" />
						<span class="txtblue" id="resultMenuName">*</span>
					</td>
				</tr>

				<tr>
					<th>打开方式</th>
					<td><select name="menu.open" size="1">
							<option value="">
								右边
							</option>
							<option value="_blank">
								新窗口打开
							</option>
						</select>
					</td>
				</tr>
				<tr>
					<th>是否是菜单</th>
					<td>
						<s:select list="flgMap" name="menu.ismenu"></s:select>
					</td>

				</tr>
				<tr>
					<th>
						排序方式
					</th>

					<td>
						<s:textfield name="menu.orders" id="menu.orders" size="30"
							maxlength="5" />
					</td>

				</tr>
				<tr>
					<th>
						URL
					</th>
					<td>
						<s:textfield name="menu.url" id="menu.url" size="50"
							maxlength="200" />
					</td>
				</tr>
				<tr>
					<th>
						已实现按钮
					</th>
					<td>
					<s:checkboxlist list="grpMap" name="grpValues"></s:checkboxlist>
					</td>
				</tr>
				<tr>
					<th>
						是否有效
					</th>
					<td>
					<s:select list="flgMap" name="menu.vldMrk"></s:select>
					</td>
				</tr>
			</table>
		<table width="80%" border="0" align="center" cellpadding="3" cellspacing="1">
			<s:token></s:token>
		    <tr>
		      <td align="center"  >
		      <div align="center">
		      	<input type="submit" value="" class="apply_style" align="middle" />
		        <input type="button" onclick="javascript:location='menuAction_list.do'" class="back_style"  />
		        <input type="reset" id="重置 " class="reset_style" value=""/>
		        </div>
		        </td>
		    </tr>
		</table>
		</div>
		</div>
		</s:form>
	</body>
</html>
